using UnityEngine;
using Unity.VisualScripting;

namespace LS.VisualScripting
{
    public class PlayMusic : SoundUnit
    {
        [DoNotSerialize]
        [PortLabelHidden]
        public ValueInput MusicId { get; set; }
        
        protected override void Definition()
        {
            base.Definition();
            MusicId = ValueInput<int>(nameof(MusicId), 0);
        }

        protected override ControlOutput In(Flow flow)
        {
            int musicId = flow.GetValue<int>(MusicId);
            Target?.PlayMusic(musicId);
            return base.In(flow);
        }
    }
}